﻿using System.Web.Mvc;

namespace MVC4App.Areas.Administrators
{
    public class AdministratorsAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Administrators";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Administrators", "a",
                new { controller = "Admin", action = "Index", id = UrlParameter.Optional });

            context.MapRoute("Administrators_page", "a/paged/{controller}/{siteId}",
                new { controller = "Site", action = "GetPaged", siteId = UrlParameter.Optional });            

            context.MapRoute(
                "Administrators_index", "a/{controller}/{siteId}",
                new { controller = "Admin", action = "Index", siteId = UrlParameter.Optional });

            //context.MapRoute(
            //    "Administrators_action", "a/{controller}/{siteId}/{action}",
            //    new { controller = "Admin", action = "Index", siteId = UrlParameter.Optional });

            context.MapRoute("Administrators_default", "a/{controller}/{siteId}/{perId}/{action}",
                new { controller = "Admin", action = "Index", siteId = UrlParameter.Optional, perId=UrlParameter.Optional });

            //context.MapRoute(
            //    "Administrators_system",
            //    "a/system/{id}",
            //    new { controller = "Shared", action = "Pages", id = UrlParameter.Optional });
            //context.MapRoute(
            //    "Administrators_content",
            //    "a/content/{id}/{act}",
            //    new { controller = "Shared", action = "Contents", id = UrlParameter.Optional, act = UrlParameter.Optional });
            //context.MapRoute(
            //    "Administrators_list",
            //    "a/partial/{id}/{act}",
            //    new { controller = "Shared", action = "ListView", id = UrlParameter.Optional, act = UrlParameter.Optional });
            context.MapRoute(
                "Administrators_default1",
                "a/{controller}/{action}",
                new { action = "Index"});
        }
    }
}
